#include "common.fxh"
#include "States.fxh"

PS_IN_POSITION3_TEX VS(VS_IN_POSITION3_TEX aInput){
  
	PS_IN_POSITION3_TEX Output;
	
	Output.Pos = mul(aInput.Pos, World);
	Output.Pos = mul(Output.Pos, ViewProjection);
	
	Output.Tex = aInput.Tex;

	return Output;  
}

PS_IN_POSITION3_TEX VS_hud(VS_IN_POSITION3_TEX aInput){
  
	PS_IN_POSITION3_TEX Output;
	
	Output.Pos = mul(aInput.Pos, World);
	
	Output.Tex = aInput.Tex;

	return Output;  
}

float4 PS(PS_IN_POSITION3_TEX aInput) : SV_Target{
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex);
}

float4 PSRepeatingHorizontal(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.x = RepeatingX;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex);
}

float4 PSRepeatingVertical(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.y = RepeatingY;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex);
}

float4 PSRepeatingBoth(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.x = RepeatingX;
	aInput.Tex.y = RepeatingY;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex);
}

float4 PS_col(PS_IN_POSITION3_TEX aInput) : SV_Target{
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex) * Coloring;
}

float4 PSRepeatingHorizontal_col(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.x = RepeatingX;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex) * Coloring;
}

float4 PSRepeatingVertical_col(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.y = RepeatingY;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex) * Coloring;
}

float4 PSRepeatingBoth_col(PS_IN_POSITION3_TEX aInput) : SV_Target{
	aInput.Tex.x = RepeatingX;
	aInput.Tex.y = RepeatingY;
	return Tex2D_0.Sample(PlaneTextureSampler, aInput.Tex) * Coloring;
}

technique10 Render{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_col{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS_col()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_opq{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS()));
        SetBlendState(BlendState_opq, float4(0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_hud{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS_hud()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_hud_opq{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS_hud()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS()));
        SetBlendState(BlendState_opq, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingVertical_hud{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS_hud()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingVertical()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingHorizontal_hud{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS_hud()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingHorizontal()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingBoth_hud{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS_hud()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingBoth()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingVertical{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingVertical()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingHorizontal{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingHorizontal()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingBoth{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingBoth()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingVertical_col{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingVertical_col()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingHorizontal_col{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingHorizontal_col()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}

technique10 Render_RepeatingBoth_col{
	pass P0{
		SetVertexShader(CompileShader(vs_4_0, VS()));
        SetGeometryShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PSRepeatingBoth_col()));
        SetBlendState(BlendState_alp, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    }
}
